function typeOf (obj) {
  if (obj === null) return String(null)
  return typeof obj === 'object'
    ? Object.prototype.toString.call(obj).replace(/(\[object|\])/g, '').toLowerCase()
    : typeof obj
}
let obj = typeOf({})
let arr = typeOf([])
let number = typeOf(123)
let str = typeOf('hello')
let fun = typeOf(function fn () { })
let bool = typeOf(true)
let nul = typeOf(null)
let kong = typeOf()
console.log(obj, arr, number, str, fun, bool, nul, kong);